package com.punch.common.enums.order;

/**
 * @author xiaol
 * @date 2020/7/21 15:53
 * 年级枚举
 */

public enum OrderStatusEnum {

    TO_PAY(0, "待付款"),

    HAVE_PAY(1, "已付款"),

    HAVE_CANCEL(2, "已取消"),

    OPEN_CLASS(3, "已开班"),

    FINISH(4, "完成");

    OrderStatusEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    private int code;
    private String name;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    public static String getName(Integer code) {
        if (code == null) {
            return "";
        }
        for (OrderStatusEnum roleEnum : OrderStatusEnum.values()) {
            if (roleEnum.getCode() == code) {
                return roleEnum.getName();
            }
        }
        return "";
    }
}

